home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / doom / quake2.zip / QJOE19.ZIP / PLAYER.QC < prev    next >
Text File  |  1996-08-20  |  24KB  |  785 lines

  1.  
  2. void() bubble_bob;
  3.  
  4. /*
  5. ==============================================================================
  6.  
  7. PLAYER
  8.  
  9. ==============================================================================
  10. */
  11.  
  12. $cd /raid/quake/id1/models/player_4
  13. $origin 0 -6 24
  14. $base base              
  15. $skin skin
  16.  
  17. //
  18. // running
  19. //
  20. $frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6
  21.  
  22. $frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6
  23.  
  24. //
  25. // standing
  26. //
  27. $frame stand1 stand2 stand3 stand4 stand5
  28.  
  29. $frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6
  30. $frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12
  31.  
  32.  
  33. //
  34. // pain
  35. //
  36. $frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6
  37.  
  38. $frame pain1 pain2 pain3 pain4 pain5 pain6
  39.  
  40.  
  41. //
  42. // death
  43. //
  44.  
  45. $frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6
  46. $frame axdeth7 axdeth8 axdeth9
  47.  
  48. $frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8
  49. $frame deatha9 deatha10 deatha11
  50.  
  51. $frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8
  52. $frame deathb9
  53.  
  54. $frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8
  55. $frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15
  56.  
  57. $frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7
  58. $frame deathd8 deathd9
  59.  
  60. $frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7
  61. $frame deathe8 deathe9
  62.  
  63. //
  64. // attacks
  65. //
  66. $frame nailatt1 nailatt2
  67.  
  68. $frame light1 light2
  69.  
  70. $frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6
  71.  
  72. $frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6
  73.  
  74. $frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6
  75.  
  76. $frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6
  77.  
  78. $frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6
  79.  
  80. $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
  81.  
  82.  
  83. /*
  84. ==============================================================================
  85. PLAYER
  86. ==============================================================================
  87. */
  88.  
  89. void() player_run;
  90.  
  91. void()  player_stand1 =[        $axstnd1,       player_stand1   ]
  92. {
  93.     self.weaponframe=0;
  94.     if (self.velocity_x || self.velocity_y)
  95.     {
  96.         self.walkframe=0;
  97.         player_run();
  98.         return;
  99.     }
  100.  
  101.     if (self.weapon == IT_AXE)
  102.     {
  103.         if (self.walkframe >= 12)
  104.             self.walkframe = 0;
  105.         self.frame = $axstnd1 + self.walkframe;
  106.     }
  107.     else
  108.     {
  109.         if (self.walkframe >= 5)
  110.             self.walkframe = 0;
  111.         self.frame = $stand1 + self.walkframe;
  112.     }
  113.     self.walkframe = self.walkframe + 1;    
  114. };
  115.  
  116. void()  player_run =[   $rockrun1,      player_run      ]
  117. {
  118.     self.weaponframe=0;
  119.     if (!self.velocity_x && !self.velocity_y)
  120.     {
  121.         self.walkframe=0;
  122.         player_stand1();
  123.         return;
  124.     }
  125.  
  126.     if (self.weapon == IT_AXE)
  127.     {
  128.         if (self.walkframe == 6)
  129.             self.walkframe = 0;
  130.         self.frame = $axrun1 + self.walkframe;
  131.     }
  132.     else
  133.     {
  134.         if (self.walkframe == 6)
  135.             self.walkframe = 0;
  136.         self.frame = self.frame + self.walkframe;
  137.     }
  138.     self.walkframe = self.walkframe + 1;
  139. };
  140.  
  141.  
  142. void()  player_shot1 =  [$shotatt1, player_shot2        ] {self.weaponframe=1;
  143. self.effects = self.effects | EF_MUZZLEFLASH;};
  144. void()  player_shot2 =  [$shotatt2, player_shot3        ] {self.weaponframe=2;};
  145. void()  player_shot3 =  [$shotatt3, player_shot4        ] {self.weaponframe=3;};
  146. void()  player_shot4 =  [$shotatt4, player_shot5        ] {self.weaponframe=4;};
  147. void()  player_shot5 =  [$shotatt5, player_shot6        ] {self.weaponframe=5;};
  148. void()  player_shot6 =  [$shotatt6, player_run  ] {self.weaponframe=6;};
  149.  
  150. void()  player_axe1 =   [$axatt1, player_axe2   ] {self.weaponframe=1;};
  151. void()  player_axe2 =   [$axatt2, player_axe3   ] {self.weaponframe=2;};
  152. void()  player_axe3 =   [$axatt3, player_axe4   ] {self.weaponframe=3;W_FireAxe();};
  153. void()  player_axe4 =   [$axatt4, player_run    ] {self.weaponframe=4;};
  154.  
  155. void()  player_axeb1 =  [$axattb1, player_axeb2 ] {self.weaponframe=5;};
  156. void()  player_axeb2 =  [$axattb2, player_axeb3 ] {self.weaponframe=6;};
  157. void()  player_axeb3 =  [$axattb3, player_axeb4 ] {self.weaponframe=7;W_FireAxe();};
  158. void()  player_axeb4 =  [$axattb4, player_run   ] {self.weaponframe=8;};
  159.  
  160. void()  player_axec1 =  [$axattc1, player_axec2 ] {self.weaponframe=1;};
  161. void()  player_axec2 =  [$axattc2, player_axec3 ] {self.weaponframe=2;};
  162. void()  player_axec3 =  [$axattc3, player_axec4 ] {self.weaponframe=3;W_FireAxe();};
  163. void()  player_axec4 =  [$axattc4, player_run   ] {self.weaponframe=4;};
  164.  
  165. void()  player_axed1 =  [$axattd1, player_axed2 ] {self.weaponframe=5;};
  166. void()  player_axed2 =  [$axattd2, player_axed3 ] {self.weaponframe=6;};
  167. void()  player_axed3 =  [$axattd3, player_axed4 ] {self.weaponframe=7;W_FireAxe();};
  168. void()  player_axed4 =  [$axattd4, player_run   ] {self.weaponframe=8;};
  169.  
  170.  
  171. //============================================================================
  172.  
  173. void() player_nail1   =[$nailatt1, player_nail2  ] 
  174. {
  175.     self.effects = self.effects | EF_MUZZLEFLASH;
  176.  
  177.     if (!self.button0)
  178.         {player_run ();return;}
  179.     self.weaponframe = self.weaponframe + 1;
  180.     if (self.weaponframe == 9)
  181.         self.weaponframe = 1;
  182.     SuperDamageSound();
  183.     W_FireSpikes (4);
  184.     self.attack_finished = time + 0.2;
  185. };
  186. void() player_nail2   =[$nailatt2, player_nail1  ]
  187. {
  188.     self.effects = self.effects | EF_MUZZLEFLASH;
  189.  
  190.     if (!self.button0)
  191.         {player_run ();return;}
  192.     self.weaponframe = self.weaponframe + 1;
  193.     if (self.weaponframe == 9)
  194.         self.weaponframe = 1;
  195.     SuperDamageSound();
  196.     W_FireSpikes (-4);
  197.     self.attack_finished = time + 0.2;
  198. };
  199.  
  200. //============================================================================
  201.  
  202. void() player_light1   =[$light1, player_light2  ] 
  203. {
  204.     self.effects = self.effects | EF_MUZZLEFLASH;
  205.  
  206.     if (!self.button0)
  207.         {player_run ();return;}
  208.     self.weaponframe = self.weaponframe + 1;
  209.     if (self.weaponframe == 5)
  210.         self.weaponframe = 1;
  211.     SuperDamageSound();
  212.     W_FireLightning();
  213.     self.attack_finished = time + 0.2;
  214. };
  215. void() player_light2   =[$light2, player_light1  ]
  216. {
  217.     self.effects = self.effects | EF_MUZZLEFLASH;
  218.  
  219.     if (!self.button0)
  220.         {player_run ();return;}
  221.     self.weaponframe = self.weaponframe + 1;
  222.     if (self.weaponframe == 5)
  223.         self.weaponframe = 1;
  224.     SuperDamageSound();
  225.     W_FireLightning();
  226.     self.attack_finished = time + 0.2;
  227. };
  228.  
  229. //============================================================================
  230.  
  231.  
  232. void() player_rocket1   =[$rockatt1, player_rocket2  ] {self.weaponframe=1;
  233. self.effects = self.effects | EF_MUZZLEFLASH;};
  234. void() player_rocket2   =[$rockatt2, player_rocket3  ] {self.weaponframe=2;};
  235. void() player_rocket3   =[$rockatt3, player_rocket4  ] {self.weaponframe=3;};
  236. void() player_rocket4   =[$rockatt4, player_rocket5  ] {self.weaponframe=4;};
  237. void() player_rocket5   =[$rockatt5, player_rocket6  ] {self.weaponframe=5;};
  238. void() player_rocket6   =[$rockatt6, player_run  ] {self.weaponframe=6;};
  239. void(float num_bubbles) DeathBubbles;
  240.  
  241. void() PainSound =
  242. {
  243. local float             rs;
  244.  
  245.     if (self.health < 0)
  246.         return;
  247.  
  248.     if (damage_attacker.classname == "teledeath")
  249.     {
  250.         sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
  251.         return;
  252.     }
  253.  
  254. // water pain sounds
  255.     if (self.watertype == CONTENT_WATER && self.waterlevel == 3)
  256.     {
  257.         DeathBubbles(1);
  258.         if (random() > 0.5)
  259.             sound (self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM);
  260.         else
  261.             sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM);
  262.         return;
  263.     }
  264.  
  265. // slime pain sounds
  266.     if (self.watertype == CONTENT_SLIME)
  267.     {
  268. // FIX ME       put in some steam here
  269.         if (random() > 0.5)
  270.             sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
  271.         else
  272.             sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
  273.         return;
  274.     }
  275.  
  276.     if (self.watertype == CONTENT_LAVA)
  277.     {
  278.         if (random() > 0.5)
  279.             sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
  280.         else
  281.             sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
  282.         return;
  283.     }
  284.  
  285.     if (self.pain_finished > time)
  286.     {
  287.         self.axhitme = 0;
  288.         return;
  289.     }
  290.     self.pain_finished = time + 0.5;
  291.  
  292. // don't make multiple pain sounds right after each other
  293.  
  294. // ax pain sound
  295.     if (self.axhitme == 1)
  296.     {
  297.         self.axhitme = 0;
  298.         sound (self, CHAN_VOICE, "player/axhit1.wav", 1, ATTN_NORM);
  299.         return;
  300.     }
  301.     
  302.  
  303.     rs = rint((random() * 5) + 1);
  304.  
  305.     self.noise = "";
  306.     if (rs == 1)
  307.         self.noise = "player/pain1.wav";
  308.     else if (rs == 2)
  309.         self.noise = "player/pain2.wav";
  310.     else if (rs == 3)
  311.         self.noise = "player/pain3.wav";
  312.     else if (rs == 4)
  313.         self.noise = "player/pain4.wav";
  314.     else if (rs == 5)
  315.         self.noise = "player/pain5.wav";
  316.     else
  317.         self.noise = "player/pain6.wav";
  318.  
  319.     sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
  320.     return;
  321. };
  322.  
  323. void()  player_pain1 =  [       $pain1, player_pain2    ] {PainSound();self.weaponframe=0;};
  324. void()  player_pain2 =  [       $pain2, player_pain3    ] {};
  325. void()  player_pain3 =  [       $pain3, player_pain4    ] {};
  326. void()  player_pain4 =  [       $pain4, player_pain5    ] {};
  327. void()  player_pain5 =  [       $pain5, player_pain6    ] {};
  328. void()  player_pain6 =  [       $pain6, player_run      ] {};
  329.  
  330. void()  player_axpain1 =        [       $axpain1,       player_axpain2  ] {PainSound();self.weaponframe=0;};
  331. void()  player_axpain2 =        [       $axpain2,       player_axpain3  ] {};
  332. void()  player_axpain3 =        [       $axpain3,       player_axpain4  ] {};
  333. void()  player_axpain4 =        [       $axpain4,       player_axpain5  ] {};
  334. void()  player_axpain5 =        [       $axpain5,       player_axpain6  ] {};
  335. void()  player_axpain6 =        [       $axpain6,       player_run      ] {};
  336.  
  337. void() player_pain =
  338. {
  339.     if (self.weaponframe)
  340.         return;
  341.  
  342.     if (self.invisible_finished > time)
  343.         return;         // eyes don't have pain frames
  344.  
  345.     if (self.weapon == IT_AXE)
  346.         player_axpain1 ();
  347.     else
  348.         player_pain1 ();
  349. };
  350.  
  351. void() player_diea1;
  352. void() player_dieb1;
  353. void() player_diec1;
  354. void() player_died1;
  355. void() player_diee1;
  356. void() player_die_ax1;
  357.  
  358. void() DeathBubblesSpawn =
  359. {
  360. local entity    bubble;
  361.     if (self.owner.waterlevel != 3)
  362.         return;
  363.     bubble = spawn();
  364.     setmodel (bubble, "progs/s_bubble.spr");
  365.     setorigin (bubble, self.owner.origin + '0 0 24');
  366.     bubble.movetype = MOVETYPE_NOCLIP;
  367.     bubble.solid = SOLID_NOT;
  368.     bubble.velocity = '0 0 15';
  369.     bubble.nextthink = time + 0.5;
  370.     bubble.think = bubble_bob;
  371.     bubble.classname = "bubble";
  372.     bubble.frame = 0;
  373.     bubble.cnt = 0;
  374.     setsize (bubble, '-8 -8 -8', '8 8 8');
  375.     self.nextthink = time + 0.1;
  376.     self.think = DeathBubblesSpawn;
  377.     self.air_finished = self.air_finished + 1;
  378.     if (self.air_finished >= self.bubble_count)
  379.         remove(self);
  380. };
  381.  
  382. void(float num_bubbles) DeathBubbles =
  383. {
  384. local entity    bubble_spawner;
  385.     
  386.     bubble_spawner = spawn();
  387.     setorigin (bubble_spawner, self.origin);
  388.     bubble_spawner.movetype = MOVETYPE_NONE;
  389.     bubble_spawner.solid = SOLID_NOT;
  390.     bubble_spawner.nextthink = time + 0.1;
  391.     bubble_spawner.think = DeathBubblesSpawn;
  392.     bubble_spawner.air_finished = 0;
  393.     bubble_spawner.owner = self;
  394.     bubble_spawner.bubble_count = num_bubbles;
  395.     return;
  396. };
  397.  
  398.  
  399. void() DeathSound =
  400. {
  401. local float             rs;
  402.  
  403.     // water death sounds
  404.     if (self.waterlevel == 3)
  405.     {
  406.         DeathBubbles(20);
  407.         sound (self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NONE);
  408.         return;
  409.     }
  410.     
  411.     rs = rint ((random() * 4) + 1);
  412.     if (rs == 1)
  413.         self.noise = "player/death1.wav";
  414.     if (rs == 2)
  415.         self.noise = "player/death2.wav";
  416.     if (rs == 3)
  417.         self.noise = "player/death3.wav";
  418.     if (rs == 4)
  419.         self.noise = "player/death4.wav";
  420.     if (rs == 5)
  421.         self.noise = "player/death5.wav";
  422.  
  423.     sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE);
  424.     return;
  425. };
  426.  
  427.  
  428. void() PlayerDead =
  429. {
  430.     self.nextthink = -1;
  431. // allow respawn after a certain time
  432.     self.deadflag = DEAD_DEAD;
  433.     self.ishead = 0;
  434. };
  435.  
  436. vector(float dm) VelocityForDamage =
  437. {
  438.     local vector v;
  439.  
  440.     v_x = 100 * crandom();
  441.     v_y = 100 * crandom();
  442.     v_z = 200 + 100 * random();
  443.  
  444.     if (dm > -50)
  445.     {
  446. //              dprint ("level 1\n");
  447.         v = v * 0.7;
  448.     }
  449.     else if (dm > -200)
  450.     {
  451. //              dprint ("level 3\n");
  452.         v = v * 2;
  453.     }
  454.     else
  455.         v = v * 10;
  456.  
  457.     return v;
  458. };
  459.  
  460. void(string gibname, float dm) ThrowGib =
  461. {
  462.     local   entity new;
  463.     new = spawn();
  464.     new.origin = self.origin;
  465.     setmodel (new, gibname);
  466.     setsize (new, '0 0 0', '0 0 0');
  467.     new.velocity = VelocityForDamage (dm);
  468.     new.movetype = MOVETYPE_BOUNCE;
  469.     new.solid = SOLID_NOT;
  470.     new.avelocity_x = random()*600;
  471.     new.avelocity_y = random()*600;
  472.     new.avelocity_z = random()*600;
  473.     new.think = SUB_Remove;
  474.     new.ltime = time;
  475.     new.nextthink = time + 10 + random()*10;
  476.     new.frame = 0;
  477.     new.flags = 0;
  478.     
  479. };
  480.  
  481. void(string gibname, float dm) ThrowHead =
  482. {
  483.     setmodel (self, gibname);
  484.     self.frame = 0;
  485.     self.nextthink = -1;
  486.     self.movetype = MOVETYPE_BOUNCE;
  487.     self.solid = SOLID_NOT;
  488.     self.takedamage = DAMAGE_NO;
  489.     self.view_ofs = '0 0 8';
  490.     setsize (self, '-16 -16 0', '16 16 56');
  491.     self.velocity = VelocityForDamage (dm);
  492.     self.origin_z = self.origin_z - 24;
  493.     self.flags = self.flags - (self.flags & FL_ONGROUND);
  494.     self.avelocity = crandom() * '0 600 0';
  495. };
  496.  
  497. void() GibPlayer =
  498. {
  499.     
  500.     ThrowGib ("progs/gib1.mdl", self.health);
  501.     ThrowGib ("progs/gib2.mdl", self.health);
  502.     ThrowGib ("progs/gib3.mdl", self.health);
  503.     ThrowHead ("progs/h_player.mdl", self.health);
  504.     self.deadflag = DEAD_DEAD;
  505.  
  506.     if (damage_attacker.classname == "teledeath")
  507.     {
  508.         sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
  509.         return;
  510.     }
  511.  
  512.     if (damage_attacker.classname == "teledeath2")
  513.     {
  514.         sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
  515.         return;
  516.     }
  517.         
  518.     if (random() < 0.5)
  519.         sound (self, CHAN_VOICE, "player/gib.wav", 1, ATTN_NONE);
  520.     else
  521.         sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE);
  522. };
  523.  
  524. //QJOE--Kills off player if he is a head... I haven't tried it, but i wouldnt
  525. //      use this if the player isnt currently a head.
  526.  
  527. void() deadhead =
  528. {
  529.     local   float   i;
  530.     self.items = self.items - (self.items & IT_INVISIBILITY);
  531.     self.invisible_finished = 0;    // don't die as eyes
  532.     self.invincible_finished = 0;
  533.     self.super_damage_finished = 0;
  534.     self.radsuit_finished = 0;
  535.     self.modelindex = modelindex_player;    // don't use eyes
  536.     if (deathmatch || coop)
  537.         DropBackpack();
  538.     ThrowGib("progs/gib1.mdl", self.health);
  539.     ThrowGib("progs/gib2.mdl", self.health);
  540.     ThrowGib("progs/gib3.mdl", self.health);
  541.     ThrowHead("progs/gib1.mdl", self.health);
  542.     self.weaponmodel="";
  543.     self.view_ofs = '0 0 8';
  544.     self.deadflag = DEAD_DEAD;
  545.     self.solid = SOLID_NOT;
  546.     self.ishead = 0;
  547.     self.angles_x = 0;
  548.     self.angles_z = 0;
  549.     self.flags = self.flags - (self.flags & FL_ONGROUND);
  550.     self.movetype = MOVETYPE_TOSS;
  551.     if (self.velocity_z < 10)
  552.         self.velocity_z = self.velocity_z + random()*300;
  553.     DeathSound();
  554. };
  555.  
  556. //QJOE--end
  557.  
  558.  
  559. void() PlayerDie =
  560. {
  561.     local   float   i;
  562.     
  563.     self.items = self.items - (self.items & IT_INVISIBILITY);
  564.     self.invisible_finished = 0;    // don't die as eyes
  565.     self.invincible_finished = 0;
  566.     self.super_damage_finished = 0;
  567.     self.radsuit_finished = 0;
  568.     self.modelindex = modelindex_player;    // don't use eyes
  569.  
  570.     //QJOE--Routine to turn player into a head... change that 75 to a 100
  571.     //      to have player always turn into a head when he dies... FUN!
  572.     if (random()*100 < 75)
  573.     {
  574.     setmodel (self, "progs/h_player.mdl");
  575.     self.frame = 0;
  576.     self.nextthink = -1;
  577.     self.movetype = MOVETYPE_WALK;
  578.     self.health = 20;
  579.     self.max_health = 50;
  580.     self.solid = SOLID_SLIDEBOX;
  581.     self.takedamage = DAMAGE_AIM;
  582.     self.view_ofs = '0 0 10';
  583.     self.weaponmodel="";
  584.     self.ishead = 1;
  585.     self.th_die = deadhead;
  586.     self.ammo_shells = 0;
  587.     self.ammo_rockets = 0;
  588.     self.ammo_cells = 0;
  589.     self.ammo_nails = 0;
  590.     W_SetCurrentAmmo ();
  591.     self.effects=self.flags=EF_DIMLIGHT;
  592.     dprint("\nYour Body Has Died, But Your Head Lives On!");
  593.     setsize (self, '-4 -4 0', '4 4 6');
  594.     if (deathmatch || coop)
  595.         DropBackpack();
  596.     return;
  597.     }
  598.     //QJOE--end
  599.     
  600.     if (deathmatch || coop)
  601.         DropBackpack();
  602.     
  603.     self.weaponmodel="";
  604.     self.view_ofs = '0 0 -8';
  605.     self.deadflag = DEAD_DYING;
  606.     self.solid = SOLID_NOT;
  607.     self.flags = self.flags - (self.flags & FL_ONGROUND);
  608.     self.movetype = MOVETYPE_TOSS;
  609.     self.ishead = 0;
  610.     if (self.velocity_z < 10)
  611.         self.velocity_z = self.velocity_z + random()*300;
  612.  
  613.     if (self.health < -40)
  614.     {
  615.         GibPlayer ();
  616.         return;
  617.     }
  618.  
  619.     DeathSound();
  620.     
  621.     self.angles_x = 0;
  622.     self.angles_z = 0;
  623.     
  624.     if (self.weapon == IT_AXE)
  625.     {
  626.         player_die_ax1 ();
  627.         return;
  628.     }
  629.     
  630.     i = cvar("temp1");
  631.     if (!i)
  632.         i = 1 + floor(random()*6);
  633.     
  634.     if (i == 1)
  635.         player_diea1();
  636.     else if (i == 2)
  637.         player_dieb1();
  638.     else if (i == 3)
  639.         player_diec1();
  640.     else if (i == 4)
  641.         player_died1();
  642.     else
  643.         player_diee1();
  644.  
  645. };
  646.  
  647. void() set_suicide_frame =
  648. {       // used by kill command and disconnect command
  649.     if (self.model != "progs/player.mdl")
  650.         return; // already gibbed
  651.     if (self.ishead == 1)
  652.         return;
  653.  
  654.     self.frame = $deatha11;
  655.     self.solid = SOLID_NOT;
  656.     self.movetype = MOVETYPE_TOSS;
  657.     self.deadflag = DEAD_DEAD;
  658.     self.nextthink = -1;
  659. };
  660.  
  661.  
  662. void()  player_diea1    =       [       $deatha1,       player_diea2    ] {};
  663. void()  player_diea2    =       [       $deatha2,       player_diea3    ] {};
  664. void()  player_diea3    =       [       $deatha3,       player_diea4    ] {};
  665. void()  player_diea4    =       [       $deatha4,       player_diea5    ] {};
  666. void()  player_diea5    =       [       $deatha5,       player_diea6    ] {};
  667. void()  player_diea6    =       [       $deatha6,       player_diea7    ] {};
  668. void()  player_diea7    =       [       $deatha7,       player_diea8    ] {};
  669. void()  player_diea8    =       [       $deatha8,       player_diea9    ] {};
  670. void()  player_diea9    =       [       $deatha9,       player_diea10   ] {};
  671. void()  player_diea10   =       [       $deatha10,      player_diea11   ] {};
  672. void()  player_diea11   =       [       $deatha11,      player_diea11 ] {PlayerDead();};
  673.  
  674. void()  player_dieb1    =       [       $deathb1,       player_dieb2    ] {};
  675. void()  player_dieb2    =       [       $deathb2,       player_dieb3    ] {};
  676. void()  player_dieb3    =       [       $deathb3,       player_dieb4    ] {};
  677. void()  player_dieb4    =       [       $deathb4,       player_dieb5    ] {};
  678. void()  player_dieb5    =       [       $deathb5,       player_dieb6    ] {};
  679. void()  player_dieb6    =       [       $deathb6,       player_dieb7    ] {};
  680. void()  player_dieb7    =       [       $deathb7,       player_dieb8    ] {};
  681. void()  player_dieb8    =       [       $deathb8,       player_dieb9    ] {};
  682. void()  player_dieb9    =       [       $deathb9,       player_dieb9    ] {PlayerDead();};
  683.  
  684. void()  player_diec1    =       [       $deathc1,       player_diec2    ] {};
  685. void()  player_diec2    =       [       $deathc2,       player_diec3    ] {};
  686. void()  player_diec3    =       [       $deathc3,       player_diec4    ] {};
  687. void()  player_diec4    =       [       $deathc4,       player_diec5    ] {};
  688. void()  player_diec5    =       [       $deathc5,       player_diec6    ] {};
  689. void()  player_diec6    =       [       $deathc6,       player_diec7    ] {};
  690. void()  player_diec7    =       [       $deathc7,       player_diec8    ] {};
  691. void()  player_diec8    =       [       $deathc8,       player_diec9    ] {};
  692. void()  player_diec9    =       [       $deathc9,       player_diec10   ] {};
  693. void()  player_diec10   =       [       $deathc10,      player_diec11   ] {};
  694. void()  player_diec11   =       [       $deathc11,      player_diec12   ] {};
  695. void()  player_diec12   =       [       $deathc12,      player_diec13   ] {};
  696. void()  player_diec13   =       [       $deathc13,      player_diec14   ] {};
  697. void()  player_diec14   =       [       $deathc14,      player_diec15   ] {};
  698. void()  player_diec15   =       [       $deathc15,      player_diec15 ] {PlayerDead();};
  699.  
  700. void()  player_died1    =       [       $deathd1,       player_died2    ] {};
  701. void()  player_died2    =       [       $deathd2,       player_died3    ] {};
  702. void()  player_died3    =       [       $deathd3,       player_died4    ] {};
  703. void()  player_died4    =       [       $deathd4,       player_died5    ] {};
  704. void()  player_died5    =       [       $deathd5,       player_died6    ] {};
  705. void()  player_died6    =       [       $deathd6,       player_died7    ] {};
  706. void()  player_died7    =       [       $deathd7,       player_died8    ] {};
  707. void()  player_died8    =       [       $deathd8,       player_died9    ] {};
  708. void()  player_died9    =       [       $deathd9,       player_died9    ] {PlayerDead();};
  709.  
  710. void()  player_diee1    =       [       $deathe1,       player_diee2    ] {};
  711. void()  player_diee2    =       [       $deathe2,       player_diee3    ] {};
  712. void()  player_diee3    =       [       $deathe3,       player_diee4    ] {};
  713. void()  player_diee4    =       [       $deathe4,       player_diee5    ] {};
  714. void()  player_diee5    =       [       $deathe5,       player_diee6    ] {};
  715. void()  player_diee6    =       [       $deathe6,       player_diee7    ] {};
  716. void()  player_diee7    =       [       $deathe7,       player_diee8    ] {};
  717. void()  player_diee8    =       [       $deathe8,       player_diee9    ] {};
  718. void()  player_diee9    =       [       $deathe9,       player_diee9    ] {PlayerDead();};
  719.  
  720. void()  player_die_ax1  =       [       $axdeth1,       player_die_ax2  ] {};
  721. void()  player_die_ax2  =       [       $axdeth2,       player_die_ax3  ] {};
  722. void()  player_die_ax3  =       [       $axdeth3,       player_die_ax4  ] {};
  723. void()  player_die_ax4  =       [       $axdeth4,       player_die_ax5  ] {};
  724. void()  player_die_ax5  =       [       $axdeth5,       player_die_ax6  ] {};
  725. void()  player_die_ax6  =       [       $axdeth6,       player_die_ax7  ] {};
  726. void()  player_die_ax7  =       [       $axdeth7,       player_die_ax8  ] {};
  727. void()  player_die_ax8  =       [       $axdeth8,       player_die_ax9  ] {};
  728. void()  player_die_ax9  =       [       $axdeth9,       player_die_ax9  ] {PlayerDead();};
  729.  
  730. //==QJOE==
  731. //
  732. //Use this sub if you are calling it from a routine when self would normally
  733. //be the player
  734.  
  735. void() RestoreBody = 
  736. {
  737.     local   entity spot;
  738.     setmodel (self, "progs/player.mdl");
  739.     self.max_health = 100;
  740.     self.solid = SOLID_SLIDEBOX;
  741.     self.takedamage = DAMAGE_AIM;
  742.     self.view_ofs = '0 0 22';
  743.     self.ishead = 0;
  744.     self.th_die = PlayerDie;
  745.     self.ammo_shells = 0;
  746.     self.ammo_rockets = 0;
  747.     self.ammo_cells = 0;
  748.     self.ammo_nails = 0;
  749.     W_SetCurrentAmmo ();
  750.     sprint(self, "You Have Returned to your original form\n");
  751.     setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
  752.     self.origin = spot.origin + '0 0 1';
  753.     self.angles = spot.angles;
  754.     self.fixangle = TRUE;           // turn this way immediately
  755. } ;
  756.  
  757. //==QJOE==
  758. //
  759. //Use this sub if you are calling it from a routine where other is equal to
  760. //the player
  761.  
  762. void() RestoreBodyB = 
  763. {
  764.     local   entity spot;
  765.     setmodel (other, "progs/player.mdl");
  766.     other.max_health = 100;
  767.     other.solid = SOLID_SLIDEBOX;
  768.     other.takedamage = DAMAGE_AIM;
  769.     other.view_ofs = '0 0 22';
  770.     other.ishead = 0;
  771.     other.th_die = PlayerDie;
  772.     other.ammo_shells = 0;
  773.     other.ammo_rockets = 0;
  774.     other.ammo_cells = 0;
  775.     other.ammo_nails = 0;
  776.     W_SetCurrentAmmo ();
  777.     sprint(other, "You Have Returned to your original form\n");
  778.     setsize (other, VEC_HULL_MIN, VEC_HULL_MAX);
  779.     spot = SelectSpawnPoint ();
  780.     other.origin = spot.origin + '0 0 1';
  781.     other.angles = spot.angles;
  782.     other.fixangle = TRUE;           // turn this way immediately
  783.  
  784. } ;
  785.